package com.farmUni.controller;


import com.farmUni.common.R;
import com.farmUni.entity.Liking;
import com.farmUni.service.LikingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wxy
 * @since 2024-02-04
 */
@RestController
@RequestMapping("/liking")
public class LikingController {
    @Autowired
    private LikingService likingService;
    @PostMapping("/like")
    public R<String> likeToArticle(@RequestBody Liking liking){
        return R.success(likingService.likeToArticle(liking)?"点赞成功":"点赞失败");
    }

}

